//
//  TMGGoldDetailView.m
//  TMGold
//
//  Created by apple on 2018/3/20.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGGoldDetailView.h"
@interface TMGGoldDetailView()

@end
@implementation TMGGoldDetailView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configSubView];
    }
    return self;
}
#pragma mark --SubView
- (void)configSubView{
    self.backgroundColor = [UIColor clearColor];
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0,0, UIScreenWidth, 44)
                                                    text:@"市场有风险，投资需谨慎"
                                               textColor:SecendTextColor
                                                    font:13
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentCenter];
    [self addSubview:titleLable];
    
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, titleLable.bottom, UIScreenWidth, 30)];
    whiteView.backgroundColor = [UIColor whiteColor];
    [self addSubview:whiteView];
    
    STLabel * subtitleLable = [[STLabel alloc] initWithFrame:CGRectMake(0,0, UIScreenWidth, 44)
                                                     text:@"若有疑问,请拨打客服电话"
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    [whiteView addSubview:subtitleLable];


    STButton * phpneButton = [[STButton alloc] initWithFrame:CGRectMake(0,subtitleLable.bottom + 5, UIScreenWidth, 44)
                                                      title:serviceCustomPhpne
                                                 titleColor:TM_orangeColor
                                                  titleFont:18
                                               cornerRadius:0
                                            backgroundColor:nil
                                            backgroundImage:nil
                                                      image:nil];
    phpneButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [phpneButton setClicAction:^(UIButton *sender) {
        NSMutableString* str = [[NSMutableString alloc] initWithFormat:@"telprompt://%@",serviceCustomPhpne];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    }];

    [whiteView addSubview:phpneButton];
    
    STLabel * timeLable = [[STLabel alloc] initWithFrame:CGRectMake(0,phpneButton.bottom + 10, UIScreenWidth, 20)
                                                    text:@"工作日9:00-21:00 非工作日10:00-15:00"
                                                   textColor:FirstTextColor
                                                        font:13
                                                 isSizetoFit:NO
                                               textAlignment:NSTextAlignmentCenter];
    [whiteView addSubview:timeLable];
    
    whiteView.height = timeLable.bottom + 3;
    [whiteView st_showTopShadow];
    [whiteView st_showBottomShadow];
    self.height = whiteView.bottom;
}
@end
